#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QChart>
#include <QLineSeries>
#include "SerialPortManager.h"

QT_CHARTS_USE_NAMESPACE

    namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    void populatePorts();
private slots:
    void onOpenClicked();
    void onSendClicked();
    void updateTemperature(double value);
    void logMessage(const QString &msg);

private:
    Ui::MainWindow *ui;
    QChart *m_chart;
    QLineSeries *m_series;
    SerialPortManager* m_serialManager;

    void setupChart();
    void setupConnections();
};

#endif // MAINWINDOW_H
